<!DOCTYPE html>
<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title></title>
  <link href="/styles/base.css" rel="stylesheet" type="text/css">
  <link href="/styles/public.css" rel="stylesheet" type="text/css">
  <link href="/js/plugins/datepicker/datepicker.css" rel="stylesheet">
  <link href="/styles/wenda.css" rel="stylesheet" type="text/css">
  <script type="text/javascript" src="/js/jquery/jquery.js"></script>
  <script type="text/javascript" src="/js/system/wenda.js"></script>

  <script>
        $(function () {
            // 顶
            $('.thumbup_num').click(function () {
                var userId = $(this).data('uid');
                var answerId = $(this).data('aid');
                $.get('/wenda/thumbup',{answerId:answerId,userId:userId}, function (data) {
                    if(data.success){
                        $(".thumbupnum").html(data.data);
                        alert("顶成功"); //
                        window.location.reload();
                    }else{
                        if(data.code == 102){
                            popup(data.msg);
                            window.location.href="/login.html";
                        }else{
                            alert("你今天已经顶过了");
                        }
                    }
                })
            })

            // 页面加载完,先按默认条件查询排行榜数据
            function queryrank() {
                var numType = $('._j_rank_change_flag.on').data('rank'); // 按数量条件
                var dateType = $('._j_rank_change_date.on').data('type'); // 按时间条件
                $.get('/wenda/queryRanking',{numType:numType,dateType:dateType},function (data) {
                    $('._j_rank_list').html(data);
                    console.log(data);
                })
            }
            queryrank();

            // 选择条件查询排行榜数据
            $('._j_rank_change_flag,._j_rank_change_date').click(function () {
                queryrank()
            })
        })
  </script>

</head>

<body style="position: relative;">
  <div class="topBar">
    <div class="topBarC">
      <div class="logo"><a title="马蜂窝自由行" href="javascript:;">马蜂窝自由行</a></div>
      <div class="t_nav">
        <ul id="pnl_nav" data-cs-t="headnav_wo">
          <li data-cs-p="index">
            <strong class="t"><a href="javascript:;">首页</a></strong>
          </li>
          <li data-cs-t="wenda" data-cs-p="wenda">
            <strong class="t"><a data-cs-p="from_wo_nav" href="javascript:;">问答</a></strong>
          </li>
          <li data-cs-t="things" data-cs-p="things">
            <strong class="t"><a data-cs-p="from_wo_nav" href="javascript:;">马蜂窝周边</a></strong>
          </li>
          <li data-cs-p="together">
            <strong class="t"><a href="javascript:;">结伴</a></strong>
          </li>
          <li data-cs-p="group">
            <strong class="t"><a href="javascript:;">小组</a></strong>
          </li>
          <li data-cs-p="mall">
            <strong class="t"><a href="javascript:;">蜂首俱乐部</a></strong>
          </li>
          <li class="drop" data-cs-p="other">
            <strong class="t"><a href="javascript:;">更多<b></b></a></strong>
          </li>
        </ul>
      </div>
      <div class="t_search">
        <form method="GET" action="/search/s.php" name="search">
          <input type="text" class="key" value="" name="q" id="word">
          <input type="submit" value="" class="btn">
        </form>
      </div>

      <div class="t_info">
        <div class="pagelet-block">
          <ul class="user_info">
            <li class="daka">
              <span class="daka_btn" id="_j_dakabtn" data-japp="daka">
                <a role="button" title="打卡" class="daka_before">打卡</a>
                <a role="button" title="打卡推荐" class="daka_after">打卡推荐</a>
              </span>
            </li>
            <li id="pnl_user_msg" data-hoverclass="on" class="msg _j_hoverclass">
              <span id="oldmsg" class="oldmsg"><a href="javascript:;" class="infoItem">消息<b></b></a></span>
              <ul id="head-msg-box" class="drop-bd">
                <li><a href="javascript:;" rel="nofollow">私信</a></li>
                <li><a href="javascript:;" rel="nofollow">小组消息</a></li>
                <li><a href="javascript:;" rel="nofollow">系统通知</a></li>
                <li><a href="javascript:;" rel="nofollow">问答消息</a></li>
                <li><a href="javascript:;" rel="nofollow">回复消息</a></li>
                <li><a href="javascript:;" rel="nofollow">喜欢与收藏</a></li>
                <li><a href="javascript:;" rel="nofollow">好友动态</a></li>
              </ul>
            </li>
            <li class="ub-item ub-new-msg" id="head-new-msg">
            </li>
            <li class="account _j_hoverclass" data-hoverclass="on" id="pnl_user_set">
              <span class="t"><a class="infoItem" href="javascript:;"><img
                    src="http://b2-q.mafengwo.net/s12/M00/35/B7/wKgED1uqIs-AMYTwAAAX-VIKIo0071.png?imageMogr2%2Fthumbnail%2F%2132x32r%2Fgravity%2FCenter%2Fcrop%2F%2132x32%2Fquality%2F90"
                    width="32" height="32" align="absmiddle"><b></b></a></span>
              <div class="uSet c">
                <div class="asset">
                  <a class="coin" href="javascript:;" target="_blank" rel="nofollow">蜂蜜 0</a>
                  /
                  <a class="coin" href="javascript:;" target="_blank" id="head-my-honey" rel="nofollow"
                    data-cs-p="coin">金币 579</a>
                </div>
                <a href="javascript:;">我的马蜂窝<b class="tb-level">LV.3</b></a>
                <a href="javascript:;" target="_blank">写游记</a>
                <a href="javascript:;" target="_blank">预约游记</a>
                <a href="javascript:;" target="_blank">我的足迹</a>
                <a href="javascript:;" target="_blank">我的问答</a>
                <a href="javascript:;" target="_blank">我的好友</a>
                <a href="javascript:;" target="_blank">我的收藏</a>
                <a href="javascript:;" target="_blank">我的路线</a>
                <a href="javascript:;" target="_blank">我的订单</a>
                <a href="javascript:;" target="_blank">我的优惠券</a>
                <a href="javascript:;" target="_blank">设置</a>
                <a href="javascript:;">退出</a>
              </div>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>

  <div class="wrapper wrapper-new">
    <div class="col-main">
      <div class="newcate-wrap _j_qa_list">
        <div class="bd newcate-bd">
          <ul class="_j_pager_box">
            <#list list as q>
            <li class="item clearfix _j_question_item" data-qid="793682">

              <div class="title">
                <a href="/wenda/wendaDetail?id=${(q.id)!}" target="_blank">${(q.title)!}</a>
              </div>
            <#list q.answers as a>
              <div class="container">

                <div class="avatar">
                    <a href="javascript:;" target="_blank" class="_j_filter_click"><img class="_j_filter_click" src="${(a.headUrl)!}"></a>
                </div>
                <div class="user-info">
                  <a class="name _j_filter_click" href="javascript:;" target="_blank">${(a.username)!}</a>
                  <a class="level _j_filter_click" href="javascript:;" target="_blank" rel="nofollow">${(a.level)!}</a>
                </div>
                <div class="desc clearfix">
                    <p>
                      ${(a.content)!}
                    </p>
                </div>
                  <div class="tags">
                      <a class="a-tag _j_filter_click" href="javascript:;" target="_blank">值得去</a>
                      <a class="a-tag _j_filter_click" href="javascript:;" target="_blank">旅游胜地</a>
                  </div>
                <div class="operate">

                  <div class="zan">
                      <a class="thumbup_num" type="button" data-aid='${(a.id)!}' data-uid='${(a.userId)!}'><span id="thumbupnum"><i></i>${(a.thumbupnum)!}</span></a>
                  </div>

                  <div class="mdd"><a href="javascript:;" class="_j_filter_click" target="_blank"><i
                          class="_j_filter_click"></i>世界</a></div>
                  <div class="cate-share">
                    <a class="_js_showShare _j_filter_click">分享</a>
                    <!-- <div class="cate-share-pop _j_share_pop hide clearfix" data-title="我要去呼伦贝尔旅行，当地有哪些美食值得去吃？"
                      data-qid="793682" data-aid="11747597" data-anum="148"
                      data-content="在燃烧着”永恒之火&quot;的草原上尽情吃肉在中国的饮食中，有许多食品都是从蒙古族那里传来的，如烤肉、涮羊肉等。似乎大家提到蒙古，都有一个感觉，那就是蒙古实在太爱吃肉了。其实蒙古人的饮食、是分为两个季节的，夏季和冬季。夏季为4月至10月，主要食物是奶制品...">
                      <a title="分享到新浪微博" class="sina _j_do_share _j_filter_click" data-site="wb"
                        data-username="肉夹馍不会认输"></a>
                      <a title="分享到QQ空间" class="zone _j_do_share _j_filter_click" data-site="qz"
                        data-username="肉夹馍不会认输"></a>
                      <a title="分享到微信" class="weixin _j_do_share_wx _j_filter_click" data-site="wx"
                        data-username="肉夹馍不会认输"></a>
                    </div> -->
                  </div>

                  <span class="reply">回答(${(q.answerNum)!})</span>
                  <span class="browse">浏览(${(q.browseNum)!})</span>
                  <span class="date">发布时间${(q.createTime? string("yyyy-MM-dd"))!}</span>
                </div>
              </div>
            </#list>
            </li>
            </#list>
          </ul>
        </div>
      </div>
    </div>

    <div class="col-side">
        <div class="i-ask">
            <a href="/wenda/public" class="qt-post-btn _j_publish" title="我要提问">我要提问</a>
        </div>
        <div class="rank _j_rank" style="margin-top: 20px;">
            <div class="hd">排行榜
                <ul class="tab-time">
                    <li class="_j_rank_change_date" data-type="0"><span>今日</span></li>
                    <li class="_j_rank_change_date on" data-type="1"><span>本周</span></li>
                    <li class="_j_rank_change_date" data-type="2"><span>本月</span></li>
                </ul>
            </div>
        <div class="bd">
          <ul class="tab-num" data-cs-p="rank_list">
            <li class="_j_rank_change_flag" data-rank="1" data-cs-d="金牌数">金牌数</li>
            <li class="_j_rank_change_flag on" data-rank="1" data-cs-d="回答数">回答数</li>
            <li class="_j_rank_change_flag" data-rank="2" data-cs-d="被顶次数">被顶次数</li>
          </ul>

          <ul class="rank-list _j_rank_list">

          </ul>

        </div>
      </div>
    </div>
  </div>
</body>

</html>